package com.ruoyi.project.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.examination.util.SnowflakeIdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mapper.A06PubNoticeMapper;
import com.ruoyi.project.domain.A06PubNotice;
import com.ruoyi.project.service.IA06PubNoticeService;

/**
 * 培训公告Service业务层处理
 * 
 * @author WorrilessGo
 * @date 2025-11-18
 */
@Service
public class A06PubNoticeServiceImpl implements IA06PubNoticeService 
{
    @Autowired
    private A06PubNoticeMapper a06PubNoticeMapper;

    /**
     * 查询培训公告
     * 
     * @param pubNoticeId 培训公告主键
     * @return 培训公告
     */
    @Override
    public A06PubNotice selectA06PubNoticeByPubNoticeId(String pubNoticeId)
    {
        return a06PubNoticeMapper.selectA06PubNoticeByPubNoticeId(pubNoticeId);
    }

    /**
     * 查询培训公告列表
     * 
     * @param a06PubNotice 培训公告
     * @return 培训公告
     */
    @Override
    public List<A06PubNotice> selectA06PubNoticeList(A06PubNotice a06PubNotice)
    {
        return a06PubNoticeMapper.selectA06PubNoticeList(a06PubNotice);
    }




    /**
     * 新增培训公告
     * 
     * @param a06PubNotice 培训公告
     * @return 结果
     */
    @Override
    public int insertA06PubNotice(A06PubNotice a06PubNotice)
    {
        a06PubNotice.setCreateTime(DateUtils.getNowDate());
        String id = String.valueOf(new SnowflakeIdUtils(5, 8).nextId());
        a06PubNotice.setPubNoticeId(id);
        a06PubNotice.setCreateBy(SecurityUtils.getUsername());
        return a06PubNoticeMapper.insertA06PubNotice(a06PubNotice);
    }

    /**
     * 修改培训公告
     * 
     * @param a06PubNotice 培训公告
     * @return 结果
     */
    @Override
    public int updateA06PubNotice(A06PubNotice a06PubNotice)
    {
        a06PubNotice.setUpdateTime(DateUtils.getNowDate());
        a06PubNotice.setUpdateBy(SecurityUtils.getUsername());
        return a06PubNoticeMapper.updateA06PubNotice(a06PubNotice);
    }

    /**
     * 批量删除培训公告
     * 
     * @param pubNoticeIds 需要删除的培训公告主键
     * @return 结果
     */
    @Override
    public int deleteA06PubNoticeByPubNoticeIds(String[] pubNoticeIds)
    {
        return a06PubNoticeMapper.deleteA06PubNoticeByPubNoticeIds(pubNoticeIds);
    }

    /**
     * 删除培训公告信息
     * 
     * @param pubNoticeId 培训公告主键
     * @return 结果
     */
    @Override
    public int deleteA06PubNoticeByPubNoticeId(String pubNoticeId)
    {
        return a06PubNoticeMapper.deleteA06PubNoticeByPubNoticeId(pubNoticeId);
    }
}
